package com.xmtlxx.common.enums;

/**
 * 模型业务枚举
 * @author RonyChan
 * @since 2022/5/4 20:53
 */
public enum ModelBussType {
    REPORT("巡查上报","0","巡查上报信息","巡查上报信息","/report/report"),
    MATTER("事件上报","1","事件上报信息","事件上报信息","/report/matter"),
    EVALU("点评","2","点评信息","点评信息","/supervise/evaluate"),
    ;

    private final String name;
    private final String code;
    private final String title;
    private final String tmpl;
    private final String route;

    ModelBussType(String name, String code, String title, String tmpl, String route) {
        this.name = name;
        this.code = code;
        this.title = title;
        this.tmpl = tmpl;
        this.route = route;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public String getTitle() {
        return title;
    }

    public String getTmpl() {
        return tmpl;
    }

    public String getRoute() {
        return route;
    }

    public static ModelBussType getBussTypeByCode(String code){
        for(ModelBussType bussType : ModelBussType.values()){
            if(bussType.getCode().equals(code)){
                return bussType;
            }
        }
        return null;
    }
}
